Sir, I would like to connect DOORS from my WCF Service. |
Re: DOORS Connection from WCF Service
It seems you are mixing up batch mode and interactive mode and have problems starting DOORS correctly. Try the code from here, if you want to start up an interactive session:
if (Process.GetProcessesByName("doors").Length == 0) {
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName= "S:\\Programme\\Telelogic\\DOORS_8.2\\bin\\doors.exe";
proc.StartInfo.Arguments = "-u Administrator -P ST1PL2";
proc.StartInfo.UseShellExecute = false;
proc.Start();
// Wait for GUI to fire up ...
proc.WaitForInputIdle();
}
DOORSCOMLib.DOORSClass d = new DOORSCOMLib.DOORSClass();
d.runStr("print \"Hallo\"");
// TODO: Implement Functionality Here
Console.Write("Check your DOORS output . . . ");
Console.ReadKey(true);
In the above code, you can use oleSetResult doors.exe -W -b filename.dxl -u Administrator -P ST1PL2 In this case you would need to write the result to a file from your DXL script, and read it from the file, so you cannot use oleSetResult in this case. Maybe that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: DOORS Connection from WCF Service Mathias Mamsch - Mon Aug 27 04:01:46 EDT 2012
It seems you are mixing up batch mode and interactive mode and have problems starting DOORS correctly. Try the code from here, if you want to start up an interactive session:
if (Process.GetProcessesByName("doors").Length == 0) {
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName= "S:\\Programme\\Telelogic\\DOORS_8.2\\bin\\doors.exe";
proc.StartInfo.Arguments = "-u Administrator -P ST1PL2";
proc.StartInfo.UseShellExecute = false;
proc.Start();
// Wait for GUI to fire up ...
proc.WaitForInputIdle();
}
DOORSCOMLib.DOORSClass d = new DOORSCOMLib.DOORSClass();
d.runStr("print \"Hallo\"");
// TODO: Implement Functionality Here
Console.Write("Check your DOORS output . . . ");
Console.ReadKey(true);
In the above code, you can use oleSetResult doors.exe -W -b filename.dxl -u Administrator -P ST1PL2 In this case you would need to write the result to a file from your DXL script, and read it from the file, so you cannot use oleSetResult in this case. Maybe that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I also tried for option 2(batch mode). This also worked for me. But I need to pass parameter in the dxl file. I am giving my sample. How can I do this. Please help string getListOfModules(string projectName) { noError() Project p = project "/" projectName string ErrMess =""; string xml="" xml= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" if( null == p) { ErrMess = projectName " Project " "Does nor Exist" xml = xml "<error>" ErrMess "</error>" oleSetResult(xml) return (xml) halt() } Regexp isCurrentProject = regexp "/" projectName "*" Item item xml = xml "<entities>\n" for item in p do { // print type(item) "\n" if(type(item) == "Formal") { if(isCurrentProject fullName(item)) { string entityName = fullName(item) xml = xml "<entity name=\"" entityName "\"" " description=\"" description(item) "\"></entity>\n" } } } xml = xml "</entities>" oleSetResult(xml) return (xml) } |
Re: DOORS Connection from WCF Service TapasMondal - Mon Sep 03 00:06:35 EDT 2012 What I like to do, is, I make a temporary batch file and write the DXL code for initializing the variables in there. Example: // test.dxl print "Parameter 1: " par1 "\n" print "Parameter 2: " par2 "\n" // launch.bat echo string par1 = "Hello " > "%TEMP%\temp.dxl" echo string par2 = "World!" >> "%TEMP%\temp.dxl" echo #include ^<%CD:\=/%/test.dxl^> >>%TEMP%\temp.dxl type %TEMP%\temp.dxl %PROGRAMFILES%\IBM\Rational\DOORS\9.3\bin\doors.exe -b "%TEMP%\temp.dxl" -u Administrator Note the special escaping syntax of the batch file using ^ and to escape the pipe operators, and the %var:a=b% syntax for replacing the backslashes to forwards slashes. If you are doing this from another language you can do this easier, the resulting temporary DXL should look like this: string par1 = "Hello " string par2 = "World!" #include <c:/temp/test.dxl> which allows passing the two parameters to the batch script. Another possibility is to use the cli statement, to declare the variables at global level: %PROGRAMFILES%\IBM\Rational\DOORS\9.3\bin\doors.exe -cli "string par1=\"Hello \"; string par2=\"World!\";" -b "test.dxl" -u Administrator
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: DOORS Connection from WCF Service TapasMondal - Mon Sep 03 00:06:35 EDT 2012 Hi TapasMondal, As you mentioned Thanks for your reply. This really help me. I used your option 1. Did option 1 mentioned by Mathias work for you and resolved error Access denied: DOORS session is not authenticated, when you call WCF service. I copied that code into my class and tried executing it. When I executed it normally, It executed successfully but when I publish web site and try to execute it as a WCF service it still displays me the same error, Could you please explain how did option 1 mentioned by Mathias worked for you
Thanks in advance Dastan Ali |